/**
 * Created by Administrator on 2019/9/29.
 */
var $ = jQuery.noConflict();

$(function(){
    $.getJSON("/easybuy/home/orderByStock",
        function(data){
        /*热卖*/
            $("#botton-scroll ul").html("");
            for(var i=0;i<4;i++){
                $("#botton-scroll ul").append("<li class='featureBox'> " +
                    "<div class='box'> " +
                    "<div class='h_icon'><img src='images/hot.png' width='50' height='50' /></div> " +
                    "<div class='imgbg'> " +
                    "<a href='Product.html?id="+data[i].id+"'><img src='images/"+data[i].fileName+"' width='160' height='136' /></a> " +
                    "</div> " +
                    "<div class='name'> " +
                    "<a href='Product.html?id="+data[i].id+"'> " +
                "<h2>"+data[i].name+"</h2>"+
                data[i].description+
                "</a> " +
                "</div> " +
                    "<div class='price'> " +
                "<font>￥<span>"+data[i].price+"</span></font> &nbsp; 26R " +
                    "</div> " +
                    "</div> " +
                    "</li>");
            }
            
            /*猜你喜欢*/
            $("#botton-scroll1 ul").html("");
            for (var i = 0; i < 5; i++) {
                $("#botton-scroll1 ul").append("<li class=\"featureBox\">\n" +
                    "                                <div class=\"box\">\n" +
                    "                                    <div class=\"imgbg\">\n" +
                    "                                        <a href=\"Product.html?id="+data[i].id+"\"><img src=\"images/"+data[i].fileName+"\" width=\"160\" height=\"136\" /></a>\n" +
                    "                                    </div>                                        \n" +
                    "                                    <div class=\"name\">\n" +
                    "                                        <a href=\"Product.html?id="+data[i].id+"\">\n" +
                    "                                        <h2>"+data[i].name+"</h2>\n" +
                                                           data[i].description +
                    "                                        </a>\n" +
                    "                                    </div>\n" +
                    "                                    <div class=\"price\">\n" +
                    "                                        <font>￥<span>"+data[i].price+"</span></font> &nbsp; 26R\n" +
                    "                                    </div>\n" +
                    "                                </div>\n" +
                    "                            </li>");
            }
            

            $("#botton-scroll").jCarouselLite({
                btnNext: ".h_next",
                btnPrev: ".h_prev"
            });


            $("#botton-scroll1").jCarouselLite1({
                btnNext: ".l_next",
                btnPrev: ".l_prev"
            });
        }

    );
});

